<?php



if ($_SERVER["REQUEST_METHOD"] == "GET") {
    print_r(json_encode(array("msg" => "敏感数据,不使用get", "status" => 4)));
    return;
}

session_start();
if (!isset($_SESSION["userinfo"])) {
    print_r(json_encode(array("msg" => "没登录", "status" => 3)));
    return;
}

$cid = $_REQUEST["cid"];

include "./DBheuper.php";

//如果已经购买了 修改数量
$update = "DELETE FROM cartslist WHERE  c_id='" . $cid . "'";

$uReulst = sqlQuery($update); //更新的结果
if ($uReulst == 1) {
    print_r(json_encode(array("msg" => "删除成功", "status" => 1)));
} else {
    print_r(json_encode(array("msg" => "删除失败", "status" => 2)));
}
